﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<% var options = ViewData["Options"] as Dictionary<string, string> ?? new Dictionary<string, string>(); %>
<% var key = ViewData["Key"].ToString(); %>
<div class="selected">
    <span class="note">开始时间</span> <a href="javascript:void(0);" onclick="Down('<%= key %>');"
        rel="ShowDropDown"></a>
</div>
<div id="DropDown<%= key %>" class="select_list time_select_list clear" style="display: none;">
    <% foreach (var option in options)
       { %>
    <a href="javascript:void(0);" onclick="SelectOptions('<%= option.Key %>', '<%= key %>');">
        <%= option.Value %></a>
    <% } %>
    <%= Html.Hidden(key, options.Keys) %>
</div>
<script type="text/javascript">
    function Down(key) {
        if ($("#DropDown" + key).css("display") == "none") {
            $("#DropDown" + key).show();
        } else {
            $("#DropDown" + key).hide();
        }
    }

    function SelectOptions(optionKey, dropDownKey) {
        $("#" + dropDownKey).val(optionKey);
    }

    
</script>
